package com.lzp.customview.curve

import android.os.Bundle
import com.base.BaseActivity
import com.lzp.customview.R
import kotlinx.android.synthetic.main.curve_activity.*

/**
 * @describe:
 * @Author: lixiaopeng
 * @Date: 2020/10/26
 */
class CurveActivity :BaseActivity(){
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.curve_activity)
    }

    override fun initView() {
        val list  = ArrayList<Point>()
        for (index in 10..100 step 2){
            val random = Math.random()
            val point = Point(index.toFloat(),(index*random).toFloat())
            list.add(point)
        }
        curve.setStartAndEndX(10f,100f)
        curve.freshData(list)
    }
}